package cn.jizi.bshisy.service.impl;

import cn.jizi.bshisy.entity.Register;
import cn.jizi.bshisy.mapper.RegisterMapper;
import cn.jizi.bshisy.service.RegisterService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

@Service
public class RegisterServiceImpl implements RegisterService {
    @Resource
    private RegisterMapper registerMapper;
    //病人挂号
    @Override
    public int getAddRegister(Register register) {
        return registerMapper.getAddRegister(register);
    }
    //医生查看挂号信息并可以根据病人姓名和时间查询并分页
    @Override
    public List<Register> getListRegisterPage(String name,Integer diagnose, Integer currentPageNo, Integer pageSize) {
        // 计算起始位置
        currentPageNo = (currentPageNo - 1) * pageSize;
        return registerMapper.getListRegisterPage(name,diagnose, currentPageNo, pageSize);
    }
    @Override
    public int getListRegisterPageCount(String name,Integer diagnose) {
        return registerMapper.getListRegisterPageCount(name,diagnose);
    }
}
